// pages/auth/auth_idcard/page_idcard.js
const util = require('../../../utils/util.js');
const api = require('../../../config/api.js');
const user = require('../../../utils/user.js');

//获取应用实例
const app = getApp()
Page({
  data: {
    navUrl: '',
    code: '',
    checked: true,
    activeIcon: '../../../images/auth_logo/agree_2x.png',
    inactiveIcon: '../../../images/auth_logo/no_agree_2x.png',
  },

  onChange(event) {
    this.setData({
      checked: event.detail,
    });

  },

  onLoad: function (options) {

  },
  goBack: function () {
    wx.navigateBack({
      delta: 1,
    })
  },

  getIdCard: function () { //点击进行实名认证
    if(!this.data.checked) {
      wx.showToast({
      
      title: '请先阅读并同意《用户服务协议》及《隐私政策》',
        icon: 'none'
      })
      return
    }
    wx.setStorageSync('is_auth', '1')
    wx.navigateBack({
      delta: 1
    })
  },
  goAgreement(){
    wx.navigateTo({
      url: '/pages/agreement/agreement',
    })
  },
  goPrivacy() {
    wx.navigateTo({
      url: '/pages/Privacy/Privacy',
    })
  },
})